package experiment6;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class No_1  {
    public static void main(String []args){
        MyStack myStack=new MyStack();
        Scanner input=new Scanner(System.in);
        System.out.println("请输入5个字符串：");
        for (int i=0;i<5;i++){
            myStack.add(input.nextLine());
        }

        Collections.sort(myStack);

        for (int i=4;i>=0;i--){
            System.out.print(myStack.get(i)+"  ");
        }
    }
}
class MyStack extends ArrayList {

}
